Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v1): show images after one line code block #3340

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

adinaja
Copy link
Contributor

@adinaja adinaja commented Aug 26, 2020

Motivation

When a markdown line starts with a code block (```) and the end of the code block is on the same line, asset images that follow after this line cannot be loaded in the next version of the documentation.
This PR fixes/improves the fenced block detection to consider this scenario.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  • Added unit tests to cover the replaceAssetsLink function

Commands/Steps to reproduce the issue

  • git clone docusaurus project
  • yarn install
  • add folder "assets" in /docs directory
  • add any image to the assets folder (I copied getting-started-preparation-verify.png from /website-1.x/static/img/ folder)
  • add the following text to any markdown file in /docs (line must start with 3 backticks): Example (break it)
  • after this line reference the image from the assets folder
  • The image is not loaded after the Example (break it) line for "next" version of the documentation
  • If you add the image before the Example (break it) line for "next" version the image is loaded

markdown to reproduce the issue

I took the getting-started-installation.md and added this content to show the issue:

Working

![this image is missing](assets/getting-started-preparation-verify.png)

```Example (break it)```

No Working

![this image is missing](assets/getting-started-preparation-verify.png)

PR_issue

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

None

@adinaja adinaja requested a review from yangshun as a code owner August 26, 2020 22:53
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 26, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit d9e6eee

https://deploy-preview-3340--docusaurus-2.netlify.app

@slorber
Copy link
Collaborator

slorber commented Aug 27, 2020

thanks :)

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Aug 27, 2020
@slorber slorber merged commit 8fd5375 into facebook:master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants